package com.ciaojian.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.github.dreamyoung.mprelation.AutoLazy;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author Atlakyn
 * @since 2021-07-05
 */
@AutoLazy
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("d_material")
public class Material extends Model<Material> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 物资名称
     */
    private String name;

    /**
     * 类型
     */
    private String type;

    /**
     * 库存数量
     */
    private Integer total;

    /**
     * 消耗数量
     */
    private Integer num;

    /**
     * 最少申请数量
     */
    private Integer minNum;

    /**
     * 最多申请数量
     */
    private Integer maxNum;

    @ApiModelProperty("单位")
    private String unit;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 备注
     */
    private String remark;

    private Date addTime;

    private Date updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
